import time

from data_push.data_push import DataPush
from db_utils import MysqlEngine
from utils import *
conn = MysqlEngine(MYSQL_USER_NAME,MYSQL_PASSWORD,MYSQL_HOST)
data_push = DataPush(conn)
data_push.push_log(WeChat_ROBOT_TEST)
# msg = '# 数据推送说明\n> 每日更新当日0点前的数据，当日推送的数据会在推送前半小时更新一次\n## 定时推送时间&内容口径说明\n###### 抖音新增主播：20:30\n> 新增主播信息\n###### 抖音直播&短视频数据监控 13:00\n> 监控主播当月数据，昨日数据增长\n###### 拉新任务 13:00\n> 监控拉新任务进行中的主播数据，不含拉新任务结束的主播数据\n###### 基线任务监控 13:00\n###### 进阶活跃任务监控 13:00\n###### 进阶短视频任务监控 13:00\n> 预估收入：根据当前音浪计算，未排除违规信息，非准确收入'
# data_push.push_test(WeChat_ROBOT_TEST)
# data_push.push_tiktok_new_anchor_add(WeChat_ROBOT_TEST)
# data_push.push_tiktok_coin_add(WeChat_ROBOT_TEST)
# data_push.push_tiktok_basic_task(WeChat_ROBOT_TEST)
# data_push.push_tiktok_process_active_task(WeChat_ROBOT_TEST)
# data_push.push_tiktok_process_video_task(WeChat_ROBOT_TEST)
# data_push.push_tiktok_new_anchor_task(WeChat_ROBOT_TEST)
# data_push.push_log(WeChat_ROBOT_TEST)
now = datetime.now().strftime("%Y-%m-%d")
msg = f'# {now}\n## 更新说明\n> 1.列宽已设置成自适应宽度>'

# data_push.push_markdown(WeChat_ROBOT_TEST, msg)
# while True:
#     time.sleep(5)
#     now = datetime.now()
#     print(now)
#     if now.hour == 20 and now.minute == 1:
#         conn = MysqlEngine(MYSQL_USER_NAME, MYSQL_PASSWORD, MYSQL_HOST)
#         data_push = DataPush(conn)
#         data_push.push_markdown(WeChat_ROBOT_Main, msg)
